home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Deutsche Edition 1
/
Deutsche Edition 1.iso
/
amok
/
051-060
/
amok52
/
gadgeted
/
txt
/
req1.mod
< prev
next >
Wrap
Text File
|
1993-11-04
|
11KB
|
423 lines
IMPLEMENTATION MODULE Req1;
(* Erstellen einer Gadget-Struktur *)
FROM SYSTEM IMPORT ADR,ADDRESS;
FROM Intuition IMPORT NewWindow, WindowPtr, IDCMPFlags, IDCMPFlagSet,
WindowFlags, WindowFlagSet, ScreenFlags,
ScreenFlagSet, OpenWindow, CloseWindow,
customScreen, Gadget, IntuiText, Border,
StringInfo, PropInfo, GadgetFlagSet,
GadgetFlags, ActivationFlags, AddGList,
ActivationFlagSet, boolGadget, strGadget,
propGadget, PropInfoFlagSet, PropInfoFlags,
RefreshGList;
FROM Graphics IMPORT jam1, jam2;
TYPE XYTyp = ARRAY [0..9] OF INTEGER;
BufTyp = ARRAY [0..255] OF CHAR;
VAR GadgWindow : NewWindow;
WPtr : WindowPtr;
Pos : INTEGER;
Gadgets : ARRAY [0..5] OF Gadget;
Borders : ARRAY [0..6] OF Border;
XY : ARRAY [0..3] OF XYTyp;
GText : ARRAY [0..5] OF IntuiText;
SInfo : ARRAY [0..1] OF StringInfo;
Buf : ARRAY [0..1] OF BufTyp;
UBuf : BufTyp;
PInfo : ARRAY [0..2] OF PropInfo;
TChar : ARRAY [0..5] OF CHAR;
PROCEDURE InitReq1
(VAR wptr : ADDRESS;
Screen : ADDRESS;
Title : ADDRESS);
(* Aufbau der Gadget-Struktur im Window *)
BEGIN
(* Window aufbauen *)
(*-----------------*)
IF (wptr = NIL) THEN
WITH GadgWindow DO
leftEdge := 75; topEdge := 19;
width := 481; height := 99;
detailPen := 0; blockPen := 1;
idcmpFlags := IDCMPFlagSet{gadgetDown,gadgetUp,closeWindow};
flags := WindowFlagSet{windowDrag,windowDepth,
windowClose,activate};
firstGadget := ADR(Gadgets[0]);
checkMark := NIL;
title := Title;
screen := Screen;
bitMap := NIL;
minWidth := 30; minHeight := 20; maxWidth := 640; maxHeight := 256;
IF (Screen # NIL) THEN
type := customScreen;
ELSE
type := ScreenFlagSet{wbenchScreen};
END; (*IF*)
END; (*WITH*)
END; (*IF*)
(*--------------------------------------------------------------------------*)
(* Aufbau der Gadget-Strukturen *)
(*------------------------------*)
WITH Gadgets[0] DO
nextGadget := ADR(Gadgets[1]);
leftEdge := 368;
topEdge := 79;
width := 70;
height := 9;
flags := GadgetFlagSet{};
activation := ActivationFlagSet{relVerify,gadgImmediate};
gadgetType := boolGadget;
gadgetRender := ADR(Borders[0]);
selectRender := NIL;
gadgetText := ADR(GText[0]);
specialInfo := NIL;
gadgetID := 0;
userData := NIL;
END; (*WITH*)
(* Gadget-Text *)
WITH GText[0] DO
frontPen := 3; backPen := 0;
drawMode := jam2;
leftEdge := 27; topEdge := 1;
iTextFont := NIL;
iText := ADR('OK');
nextText := NIL;
END; (*WITH*)
(* Gadget-Border(s) *)
WITH Borders[0] DO
leftEdge := -2; topEdge := -2;
frontPen := 1; backPen := 0;
drawMode := jam2;
count := 5;
xy := ADR(XY[0]);
nextBorder := ADR(Borders[1]);
END; (*WITH*)
XY[0,0] := 0; XY[0,1] := 0;
XY[0,2] := 73; XY[0,3] := 0;
XY[0,4] := 73; XY[0,5] := 12;
XY[0,6] := 0; XY[0,7] := 12;
XY[0,8] := 0; XY[0,9] := 0;
WITH Borders[1] DO
leftEdge := -5; topEdge := -4;
frontPen := 1; backPen := 0;
drawMode := jam2;
count := 5;
xy := ADR(XY[1]);
nextBorder := NIL;
END; (*WITH*)
XY[1,0] := 0; XY[1,1] := 0;
XY[1,2] := 79; XY[1,3] := 0;
XY[1,4] := 79; XY[1,5] := 16;
XY[1,6] := 0; XY[1,7] := 16;
XY[1,8] := 0; XY[1,9] := 0;
(*-------------------------------------------------------*)
WITH Gadgets[1] DO
nextGadget := ADR(Gadgets[2]);
leftEdge := 47;
topEdge := 79;
width := 251;
height := 11;
flags := GadgetFlagSet{};
activation := ActivationFlagSet{relVerify,gadgImmediate};
gadgetType := propGadget;
gadgetRender := ADR(Borders[2]);
selectRender := NIL;
gadgetText := ADR(GText[1]);
specialInfo := ADR(PInfo[0]);
gadgetID := 1;
userData := NIL;
END; (*WITH*)
(* Gadget-Text *)
WITH GText[1] DO
frontPen := 1; backPen := 0;
drawMode := jam2;
leftEdge := -14; topEdge := 2;
iTextFont := NIL;
TChar[0] := 'B';
TChar[1] := 00C;
iText := ADR(TChar[0]);
nextText := NIL;
END; (*WITH*)
(* Gadget-Border(s) *)
WITH Borders[2] DO
leftEdge := -2; topEdge := -2;
frontPen := 1; backPen := 0;
drawMode := jam2;
count := 5;
xy := NIL;
nextBorder := NIL;
END; (*WITH*)
(* Prop-Info *)
WITH PInfo[0] DO
flags := PropInfoFlagSet{autoKnob,freeHoriz};
horizPot := 0; vertPot := 0;
horizBody := 65535 DIV 16;
vertBody := 65535 DIV 16;
END; (*WITH*)
(*-------------------------------------------------------*)
WITH Gadgets[2] DO
nextGadget := ADR(Gadgets[3]);
leftEdge := 47;
topEdge := 64;
width := 251;
height := 11;
flags := GadgetFlagSet{};
activation := ActivationFlagSet{relVerify,gadgImmediate};
gadgetType := propGadget;
gadgetRender := ADR(Borders[3]);
selectRender := NIL;
gadgetText := ADR(GText[2]);
specialInfo := ADR(PInfo[1]);
gadgetID := 2;
userData := NIL;
END; (*WITH*)
(* Gadget-Text *)
WITH GText[2] DO
frontPen := 1; backPen := 0;
drawMode := jam2;
leftEdge := -14; topEdge := 2;
iTextFont := NIL;
TChar[2] := 'G';
TChar[3] := 00C;
iText := ADR(TChar[2]);
nextText := NIL;
END; (*WITH*)
(* Gadget-Border(s) *)
WITH Borders[3] DO
leftEdge := -2; topEdge := -2;
frontPen := 1; backPen := 0;
drawMode := jam2;
count := 5;
xy := NIL;
nextBorder := NIL;
END; (*WITH*)
(* Prop-Info *)
WITH PInfo[1] DO
flags := PropInfoFlagSet{autoKnob,freeHoriz};
horizPot := 0; vertPot := 0;
horizBody := 65535 DIV 16;
vertBody := 65535 DIV 16;
END; (*WITH*)
(*-------------------------------------------------------*)
WITH Gadgets[3] DO
nextGadget := ADR(Gadgets[4]);
leftEdge := 47;
topEdge := 49;
width := 251;
height := 11;
flags := GadgetFlagSet{};
activation := ActivationFlagSet{relVerify,gadgImmediate};
gadgetType := propGadget;
gadgetRender := ADR(Borders[4]);
selectRender := NIL;
gadgetText := ADR(GText[3]);
specialInfo := ADR(PInfo[2]);
gadgetID := 3;
userData := NIL;
END; (*WITH*)
(* Gadget-Text *)
WITH GText[3] DO
frontPen := 1; backPen := 0;
drawMode := jam2;
leftEdge := -14; topEdge := 2;
iTextFont := NIL;
TChar[4] := 'R';
TChar[5] := 00C;
iText := ADR(TChar[4]);
nextText := NIL;
END; (*WITH*)
(* Gadget-Border(s) *)
WITH Borders[4] DO
leftEdge := -2; topEdge := -2;
frontPen := 1; backPen := 0;
drawMode := jam2;
count := 5;
xy := NIL;
nextBorder := NIL;
END; (*WITH*)
(* Prop-Info *)
WITH PInfo[2] DO
flags := PropInfoFlagSet{autoKnob,freeHoriz};
horizPot := 0; vertPot := 0;
horizBody := 65535 DIV 16;
vertBody := 65535 DIV 16;
END; (*WITH*)
(*-------------------------------------------------------*)
WITH Gadgets[4] DO
nextGadget := ADR(Gadgets[5]);
leftEdge := 240;
topEdge := 16;
width := 56;
height := 8;
flags := GadgetFlagSet{};
activation := ActivationFlagSet{relVerify,gadgImmediate,stringRight,longint};
gadgetType := strGadget ;
gadgetRender := ADR(Borders[5]);
selectRender := NIL;
gadgetText := ADR(GText[4]);
specialInfo := ADR(SInfo[0]);
gadgetID := 4;
userData := NIL;
END; (*WITH*)
(* Gadget-Text *)
WITH GText[4] DO
frontPen := 3; backPen := 2;
drawMode := jam2;
leftEdge := -188; topEdge := 1;
iTextFont := NIL;
iText := ADR('Number of Colors:');
nextText := NIL;
END; (*WITH*)
(* Gadget-Border(s) *)
WITH Borders[5] DO
leftEdge := -2; topEdge := -2;
frontPen := 1; backPen := 0;
drawMode := jam2;
count := 5;
xy := ADR(XY[2]);
nextBorder := NIL;
END; (*WITH*)
XY[2,0] := 0; XY[2,1] := 0;
XY[2,2] := 59; XY[2,3] := 0;
XY[2,4] := 59; XY[2,5] := 11;
XY[2,6] := 0; XY[2,7] := 11;
XY[2,8] := 0; XY[2,9] := 0;
(* String-Info *)
WITH SInfo[0] DO
buffer := ADR(Buf[0]);
undoBuffer := ADR(UBuf);
bufferPos := 0; dispPos := 0;
maxChars := 80;
longInt := 0;
END; (*WITH*)
(*-------------------------------------------------------*)
WITH Gadgets[5] DO
nextGadget := NIL;
leftEdge := 136;
topEdge := 32;
width := 160;
height := 8;
flags := GadgetFlagSet{};
activation := ActivationFlagSet{relVerify,gadgImmediate,stringCenter};
gadgetType := strGadget ;
gadgetRender := ADR(Borders[6]);
selectRender := NIL;
gadgetText := ADR(GText[5]);
specialInfo := ADR(SInfo[1]);
gadgetID := 5;
userData := NIL;
END; (*WITH*)
(* Gadget-Text *)
WITH GText[5] DO
frontPen := 2; backPen := 1;
drawMode := jam2;
leftEdge := -83; topEdge := 0;
iTextFont := NIL;
iText := ADR('Filename:');
nextText := NIL;
END; (*WITH*)
(* Gadget-Border(s) *)
WITH Borders[6] DO
leftEdge := -2; topEdge := -2;
frontPen := 1; backPen := 0;
drawMode := jam2;
count := 5;
xy := ADR(XY[3]);
nextBorder := NIL;
END; (*WITH*)
XY[3,0] := 0; XY[3,1] := 0;
XY[3,2] := 163; XY[3,3] := 0;
XY[3,4] := 163; XY[3,5] := 11;
XY[3,6] := 0; XY[3,7] := 11;
XY[3,8] := 0; XY[3,9] := 0;
(* String-Info *)
WITH SInfo[1] DO
buffer := ADR(Buf[1]);
undoBuffer := ADR(UBuf);
bufferPos := 0; dispPos := 0;
maxChars := 16;
longInt := 0;
END; (*WITH*)
(*-------------------------------------------------------*)
(* Fenster öffnen: *)
IF (wptr = NIL) THEN
WPtr := OpenWindow (GadgWindow);
wptr := WPtr;
ELSE
Pos := AddGList (wptr,ADR(Gadgets[0]),0,6,NIL);
RefreshGList (ADR(Gadgets[0]),wptr,NIL,6);
WPtr := wptr;
END; (*IF*)
END InitReq1;
(*--------------------------------------------------------------------------*)
PROCEDURE CloseReq1;
(* Schließen des Gadget-Windows. *)
BEGIN
IF (WPtr#NIL) THEN CloseWindow (WPtr) END;
END CloseReq1;
(*--------------------------------------------------------------------------*)
PROCEDURE GetReq1GPtr (ID : INTEGER) : ADDRESS;
(* Liefert den GadgetPtr des Gadgets mit der angegebenen ID. *)
BEGIN
RETURN ADR(Gadgets[ID]);
END GetReq1GPtr;
(*--------------------------------------------------------------------------*)
BEGIN
WPtr := NIL;
END Req1.